﻿using Core;
using Core.Domain.Stores;
using System.Collections.Generic;

namespace Services.Stores
{
    /// <summary>
    /// 站点地图服务接口
    /// </summary>
    public partial interface IStoreMappingService
    {
        /// <summary>
        /// 删除站点地图
        /// </summary>
        /// <param name="storeMapping"></param>
        void DeleteStoreMapping(StoreMapping storeMapping);

        /// <summary>
        /// 根据主键获取地图
        /// </summary>
        /// <param name="storeMappingId"></param>
        /// <returns></returns>
        StoreMapping GetStoreMappingById(int storeMappingId);

        IList<StoreMapping> GetStoreMappings<T>(T entity) where T : BaseEntity;

        /// <summary>
        /// 插入地图
        /// </summary>
        /// <param name="storeMapping"></param>
        void InsertStoreMapping(StoreMapping storeMapping);

        void InsertStoreMapping<T>(T entity, int storeId) where T : BaseEntity;

        void UpdateStoreMapping(StoreMapping storeMapping);

        int[] GetStoresIdsWithAccess<T>(T entity) where T : BaseEntity;

        bool Authorize<T>(T entity) where T : BaseEntity;

        bool Authorize<T>(T entity, int storeId) where T : BaseEntity;
    }
}
